package com.qf.blog.controller;

import com.qf.blog.entity.User;
import com.qf.blog.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * User: key
 * ClassName:HomeController
 * Date: 2023/6/7
 * Time: 21:09
 * description:
 */
@Controller
@RequestMapping("/account")
public class HomeController {
    @Autowired
    private UserService userService;

    @GetMapping("/info/{id}")
    public String info(@PathVariable Integer id, ModelMap modelMap) {
        User user = userService.getById(id);
        modelMap.put("userManager", user);
        modelMap.put("hasFollowed", false); // 没有关注
        modelMap.put("followerCount", 0); // 它关注了多少人
        modelMap.put("fansCount", 0); // 它有多少粉丝
        return "site/profile";
    }
}
